<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="js/ext/resources/css/ext-all.css">

<script type="text/javascript" src="js/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="js/ext/ext-all.js"></script>
<script type="text/javascript">
function test(e){
	e = e || window.event;
    var keycode = e.which ? e.which : e.keyCode;
    var c=String.fromCharCode(keycode);
    if(/[.0-9]/.test(c)){
		alert(c);
    }else{
		event.returnValue="";
    }
}
</script>
</head>
<body>
<input type="text" onkeypress="test(window.event);">
</body>
</html>